{extend name="layout"}
{block name="title"}ThinkPHP学习 - 数据库{/block}

{block name="content"}
<script>
    var $ = layui.$;
    $('#nav-database').addClass('layui-this')
</script>

<style>
    h1{
        margin-top: 20px;
    }
    p {
        margin-left: 20px;
    }
</style>

<section>
    <h1>数据库</h1>
    <p>$cursor = Db::table('user')->where('isActive', 1)->select();</p>
    <ul>
        <li>查询表： Db::table('user')</li>
        <li>查询条件：where('isActive', 1)</li>
        <li>执行查询：select()</li>
    </ul>
</section>

<section>
    <h1>注意</h1>
    <p>php.ini的extension=pdo_mysql需要开启</p>
</section>

<section>
    <h1>例子</h1>
    <p><a href="/api/database/test" target="_blank">列表</a></p>
</section>
{/block}